package uit.shoeshop.model;

import uit.shoeshop.dto.UserDTO;
import uit.shoeshop.dao.UserDAO;

import java.sql.SQLException;

public class LoginModel {
	public LoginModel(){
		
	}
	
	public Integer checkLogin(String username,String password) throws SQLException{
		UserDTO user = new UserDTO();

		UserDAO tblUser = new UserDAO();
		user = tblUser.getUser(username, password);

		tblUser = null;
		
		if(user == null) return 0;
		else return user.getType();
	}
}
